package manage.action;

import manage.model.CostType;
import manage.service.CostTypeService;

import com.opensymphony.xwork2.ActionSupport;

/**
 * @author xuweigui
 *
 */
@SuppressWarnings("serial")
public class JsonAction extends ActionSupport {
    private CostType costType;
  //result="success" if successful, otherwise error message content
    private String result;

    private CostTypeService costTypeService;
 
    public String execute() {
        costTypeService.add(costType);        
        return SUCCESS;
    }

    public String deleteCostType() {
        costTypeService.remove(costType.getId());
        return SUCCESS;
    }

    public CostType getCostType() {
        return costType;
    }

    public void setCostType(CostType costType) {
        this.costType = costType;
    }


    public CostTypeService getCostTypeService() {
        return costTypeService;
    }


    public void setCostTypeService(CostTypeService costTypeService) {
        this.costTypeService = costTypeService;
    }


    public String getResult() {
        return result;
    }


    public void setResult(String result) {
        this.result = result;
    }
    
    
    
}
